package com.factory;

import com.iface.Shape;
import com.iface.impl.Circle;
import com.iface.impl.Rectangle;
import com.iface.impl.Square;

public class ShapeFactory {

    public Shape getShape(String shapeEnumName) {
        if ( shapeEnumName == null )
            return null;
        if ( shapeEnumName.equalsIgnoreCase("CIRCLE") )
            return new Circle();
        if ( shapeEnumName.equalsIgnoreCase("RECTANGLE") )
            return new Rectangle();
        if ( shapeEnumName.equalsIgnoreCase("SQUARE") )
            return new Square();
        return null;
    }

}
